<?php

class Announcement extends AppModel {

  public $name = 'Announcement';
  public $validate = array(
      'title' => array(
          'rule' => 'notEmpty',
          'message' => 'Title is required'
      ),
      'teaser' => array(
          'rule' => 'notEmpty',
          'message' => 'Teaser is required'
      ),
      'start_date' => array(
          'formatRule' => array(
              'rule' => array('validDateFormat'),
              'allowEmpty' => false,
              'message' => 'Enter a valid Start date (mm/dd/yyyy)'
          ),
          'dateRestrictionRule' => array(
              'rule' => array('dateBefore', 'end_date'),
              'message' => 'Start date must be before End date'
      )),
      'end_date' => array(
          'rule' => array('validDateFormat'),
          'allowEmpty' => false,
          'message' => 'Enter a valid End date (mm/dd/yyyy)'
      ),
      'image_path_1'=>array(
    
              'rule'=>array('validImageFormat'),
              'message'=>'Specify a valid image (gif, jpg, png)',
              'allowEmpty'=>true,
                'required'=>false       
      )
  );



  public function createValidationJavaScript() {
    
  }

}

?>
